package com.aspose.cells;

import java.util.ArrayList;
import java.util.Iterator;

public abstract class CollectionBase<T> implements Iterable<T> {
   protected ArrayList<T> a;

   public CollectionBase() {
      this.a = new ArrayList();
   }

   public CollectionBase(int capacity) {
      this.a = new ArrayList(capacity);
   }

   public Iterator<T> iterator() {
      return this.a.iterator();
   }

   public int getCount() {
      return this.a.size();
   }

   public void clear() {
      this.a.clear();
   }

   public int add(T o) {
      return this.a.add(o) ? this.a.size() - 1 : -1;
   }

   public T get(int index) {
      return this.a.get(index);
   }

   public boolean contains(Object o) {
      return this.a.contains(o);
   }

   public void removeAt(int index) {
      this.a.remove(index);
   }

   public int indexOf(Object o) {
      return this.a.indexOf(o);
   }
}
